home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / JScrollPane$ScrollBar.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.5 KB  |  53 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Rectangle;
  4. import javax.swing.plaf.UIResource;
  5.  
  6. public class JScrollPane$ScrollBar extends JScrollBar implements UIResource {
  7.    // $FF: synthetic field
  8.    private final JScrollPane this$0;
  9.    private boolean unitIncrementSet;
  10.    private boolean blockIncrementSet;
  11.  
  12.    public JScrollPane$ScrollBar(JScrollPane var1, int var2) {
  13.       super(var2);
  14.       this.this$0 = var1;
  15.    }
  16.  
  17.    public int getBlockIncrement(int var1) {
  18.       JViewport var2 = this.this$0.getViewport();
  19.       if (!this.blockIncrementSet && var2 != null) {
  20.          if (var2.getView() instanceof Scrollable) {
  21.             Scrollable var3 = (Scrollable)var2.getView();
  22.             Rectangle var4 = var2.getViewRect();
  23.             return var3.getScrollableBlockIncrement(var4, ((JScrollBar)this).getOrientation(), var1);
  24.          } else {
  25.             return ((JScrollBar)this).getOrientation() == 1 ? var2.getExtentSize().height : var2.getExtentSize().width;
  26.          }
  27.       } else {
  28.          return super.getBlockIncrement(var1);
  29.       }
  30.    }
  31.  
  32.    public int getUnitIncrement(int var1) {
  33.       JViewport var2 = this.this$0.getViewport();
  34.       if (!this.unitIncrementSet && var2 != null && var2.getView() instanceof Scrollable) {
  35.          Scrollable var3 = (Scrollable)var2.getView();
  36.          Rectangle var4 = var2.getViewRect();
  37.          return var3.getScrollableUnitIncrement(var4, ((JScrollBar)this).getOrientation(), var1);
  38.       } else {
  39.          return super.getUnitIncrement(var1);
  40.       }
  41.    }
  42.  
  43.    public void setBlockIncrement(int var1) {
  44.       this.blockIncrementSet = true;
  45.       super.setBlockIncrement(var1);
  46.    }
  47.  
  48.    public void setUnitIncrement(int var1) {
  49.       this.unitIncrementSet = true;
  50.       super.setUnitIncrement(var1);
  51.    }
  52. }
  53.